/**
=====================================================================================
 CAPage
 copyright M.Jurkait 2003

 Short-Description:
  Abstract Base-Class for CDialogs which will be displayed at Tab-Sheets in CCharplanView

 Description:
  Used as Baseclass for child-windows which will be displayed
  in the Tab-Sheets of the main view.
  (yeah I know there is another way to create Tabs and Sheets, don't ask why I do it
   this way. I can't remember ;) )
   Mainly there are some funktions for event handling and Document access.
   ! GetDocument will only work if this view is attached to the (only) TABCTRL of the view !

 Creating a new Page:
  Create a Class inherited by CDialog (incl. a Dialog-resource)
  Change the Dialog resource properties to 'child-window' and HIDDEN
  Replace all 'CDialog' by 'CAPage'
  Add startup Code to CCharPlanView::ActivePage and a Tab in CCharPlanView::OnInitDialog

 Changes:
=====================================================================================
**/


#pragma once
#include "afxwin.h"

class CCharplanDoc; // needed for GetDocument()


class CAPage :  public CDialog
{
        DECLARE_DYNAMIC(CAPage)
        DECLARE_MESSAGE_MAP()

    public:
        CAPage(UINT idd, CWnd*);
        ~CAPage(void);

        afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);

        /**
         Override for action on RACE changes
        **/
        virtual void OnRaceChanged() {};

        /**
         Override for action on LEVEL changes
        **/
        virtual void OnLevelChanged() {};

        /**
         Override for action on CLASS changes
        **/
        virtual void OnClassChanged() {};

        /**
         Override for action on RR (realm-rank) changes
        **/
        virtual void OnRRChanged() {};

        /**
         Override for action on Carrer-mode activation/deactivation (and snap+del)
        **/
        virtual void OnCarrerModeChanged() {};

        /**
         Override for action on ChampLevel changes
        **/
        virtual void OnChampChanged() {};

        /**
         Returns the Document
         - this function assumes that this control is attached to a control
           which is attached to the CharplanView
        **/
        CCharplanDoc* GetDocument();

        /**
         Override for actions before 'save' document
        **/
        virtual void OnSave() {};


        virtual void SetupToolTips();

        CSize       mc_init_size;

    protected:
        CPPToolTip  mToolTips;
        CResizer    m_resizer;

    protected:

        // catch default-messages (simply does nothing)
        virtual void OnCancel();
        virtual void OnOK();

    public:
        virtual BOOL OnInitDialog();
        virtual BOOL PreTranslateMessage(MSG* pMsg);
        afx_msg void OnSize(UINT nType, int cx, int cy);
};
